<template>
  <div>
      <Suspense>
          <template #default>
            <div>
                <useSuspense1/>
                <useSuspense2/>
            </div>
          </template>
          <template #fallback>
              <h1>loading....</h1>
          </template>
      </Suspense>
  </div>
</template>

<script lang="ts">
import {onErrorCaptured} from 'vue'
import useSuspense1 from './useSuspense1.vue'
import useSuspense2 from './useSuspense2.vue'
export default {
components: {
    useSuspense1,
    useSuspense2
},
setup() {
    onErrorCaptured((e:any) => {
        console.log('出错了：',e.message)
        return true
    })
}
}
</script>

<style>

</style>